@section head{
    <link href="~/theme/default/codemode.index.css" rel="stylesheet" asp-append-version="true" />
}
<div id="app" style="height: 100%;">
    <el-container>
        <el-aside width="220px">
            <el-select v-model="selected.database" placeholder="请选择库名" @@change="getTables">
                <el-option v-for="item in databases"
                           :key="item.schema_name"
                           :label="item.schema_name"
                           :value="item.schema_name">
                </el-option>
            </el-select>
            <ul class="side-nav">
                <li class="nav-item" v-for="item in tables" @@click="getFields(item.table_name)">
                    <a v-text="item.table_name"></a>
                </li>
            </ul>
        </el-aside>
        <el-main>
            <div style="flex: 1">
                <el-tabs v-model="selected.activeTabsName" type="card">
                    <el-tab-pane v-for="(item, index) in tabs"
                                 :key="item.name"
                                 :label="item.title"
                                 :name="item.name"
                                 :closable="item.closeable">
                        <div class="wrap-fields" v-if="item.fields && item.fields.length>0">
                            <el-divider content-position="left">字段列表</el-divider>
                            <el-checkbox-group v-model="item.selected_fields" @@change="handleCheckedFieldsChange(false)">
                                <el-checkbox v-for="field in item.fields" :label="field.column_name" :key="field.column_name">{{field.column_name}} <span :class="getKeyFlag(field.column_key)"></span></el-checkbox>
                            </el-checkbox-group>
                        </div>
                        <div class="content">
                            <div class="tab_param_frame">
                                <b>命名空间：</b>
                                <el-input placeholder="请输入命名空间"
                                          v-model="item.namespace">
                                </el-input>
                                <b>类名：</b>
                                <el-input placeholder="请输入类名"
                                          v-model="item.className">
                                </el-input>
                                <b>保存路径：</b>
                                <el-input placeholder="请输入保存路径"
                                          class="path"
                                          v-model="item.path">
                                </el-input>
                                <el-button type="primary" @@click="saveFile(item)">保存</el-button>
                            </div>
                            <el-input type="textarea"
                                      placeholder="请输入内容"
                                      v-model="item.content">
                            </el-input>
                        </div>
                    </el-tab-pane>
                </el-tabs>
            </div>
        </el-main>
    </el-container>
</div>

@section script{
    <script src="~/lib/template/data_type.js" asp-append-version="true"></script>
    <script src="~/lib/template/template.js" asp-append-version="true"></script>
    <script src="~/module/codemode/codemode.index.js" asp-append-version="true" type="text/babel"></script>
} 